package com.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dao.CompanyDAO;
import com.entity.Company;
import com.service.CompanyService;

@Service("companyService")
public class CompanyServiceImpl implements CompanyService {
	@Autowired
	private CompanyDAO companyDAO;

	@Override // 继承接口的新增 返回值0(失败),1(成功)
	public int insertCompany(Company company) {
		return this.companyDAO.insertCompany(company);
	}

	@Override // 继承接口的更新 返回值0(失败),1(成功)
	public int updateCompany(Company company) {
		return this.companyDAO.updateCompany(company);
	}

	@Override // 继承接口的删除 返回值0(失败),1(成功)
	public int deleteCompany(String companyid) {
		return this.companyDAO.deleteCompany(companyid);
	}

	@Override // 继承接口的查询全部
	public List<Company> getAllCompany() {
		return this.companyDAO.getAllCompany();
	}

	@Override // 继承接口的按条件精确查询
	public List<Company> getCompanyByCond(Company company) {
		return this.companyDAO.getCompanyByCond(company);
	}

	@Override // 继承接口的按条件模糊查询
	public List<Company> getCompanyByLike(Company company) {
		return this.companyDAO.getCompanyByLike(company);
	}

	@Override // 继承接口的按主键查询 返回Entity实例
	public Company getCompanyById(String companyid) {
		return this.companyDAO.getCompanyById(companyid);
	}

}


